﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" x:Class="Coding4Fun.PrinterDisplayHack.MainWindow"
		Background="{DynamicResource WindowBackgroundBrush}"
        Title="Coding4Fun Printer Display Hack" 
		Height="400" Width="330" Icon="/PrinterDisplayHack;component/images/printer.ico" 
		WindowStyle="ToolWindow" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
	<Grid x:Name="grid" Loaded="grid_Loaded">
		<Grid.RowDefinitions>
			<RowDefinition Height="30" />
			<RowDefinition Height="30" />
			<RowDefinition Height="240" />
			<RowDefinition Height="20" />
			<RowDefinition Height="30" />
		</Grid.RowDefinitions>
		<Grid Grid.Row="0" Margin="5">
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>
			<Label Content="Stock Symbol"/>
			<TextBox Grid.Column="1" x:Name="TickerSymbol" Text="{Binding StockSymbol}" />
			<Button Grid.Column="2" Content="Get Price" Margin="5,0,0,0"  Click="GetPrice_Click" />
		</Grid>
		<Grid Grid.Row="1" Margin="5">
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>
			<Label Content="Printer IP address" />
			<TextBox Grid.Column="1" x:Name="MyPrinter" Text="{Binding PrinterAddress}" />
			<Button Grid.Column="2" Content="Get Printer" Margin="5,0,0,0" Click="GetPrinter_Click" />
		</Grid>
		<RichTextBox x:Name="rtfLog" Grid.Row="2" VerticalAlignment="top" VerticalScrollBarVisibility="Auto" Height="239">
			<RichTextBox.Resources>
				<Style TargetType="{x:Type Paragraph}">
					<Setter Property="Margin" Value="0"/>
				</Style>
			</RichTextBox.Resources>
			<FlowDocument>
				<Paragraph>
					<Run Text=""/>
				</Paragraph>
			</FlowDocument>
		</RichTextBox>
		<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
			<CheckBox x:Name="chkStartup" Content="Start with Windows?" IsChecked="{Binding StartWithWindows}" VerticalAlignment="Center" Margin="0 0 5 0"/>
			<CheckBox x:Name="chkEnabled" Content="Enabled" IsChecked="{Binding Enabled}" VerticalAlignment="Center" Margin="5 0 0 0"/>
		</StackPanel>
		<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
			<Button x:Name="btnSave" Width="100" Height="30" Click="btnSave_Click" Content="Start" Margin="0 0 5 0" />
			<Button x:Name="btnExit" Width="100" Height="30" Click="btnExit_Click" Content="Quit" Margin="5 0 0 0"/>
		</StackPanel>
	</Grid>
</Window>
